app.controller('RtVehicleDetailCtrl', function ($scope, $stateParams, ajax) {

    $scope.vehicleId = $stateParams.vehicleId;

    //查询
    $scope.reload = function () {
        ajax.call(new Req.GET({
            resource: 'vehicle/rt/' + $scope.vehicleId + '/id'
        })).then(function (result) {
            if (result.code && result.code == 200) {
                $scope.vehicle = result.result.vehicle;
                $scope.vehicleInsurance = result.result.vehicleInsurance;
                $scope.driverlist = result.result.drivers;
            }
        }, function () { });
    };

    $scope.reload();
});

app.filter('statusFilter', function () {
    return function (status) {
        switch (status) {
            case 0:
                return '未激活';
            case 1:
                return '已激活';
            case 2:
                return '暂停执行任务';
            case 3:
                return '黑名单中';
            case 4:
                return '执行任务中';
            default:
                return '';
        }
    };
});